import { paragraphPropsType } from '@/types/props'
import styles from './QuestionParagraph.module.scss'
import React, { FC } from 'react'

const QuestionParagraph:FC<paragraphPropsType> = ({props}) => {
  const {text,isCenter} = props

  const textList = text.split('\n')

  return (
   <div className={styles.container} style={{textAlign: isCenter ? 'center' : 'left'}}>
      {textList.map((item,index)=>(
        <span key={index}>
          {index>0 && <br/>}
          {item}
        </span>
      ))}
    </div>
  )
}

export default QuestionParagraph
